function go(num){
    var item=document.querySelectorAll('header div')
    var fenlei=document.querySelectorAll('.fenlei')
    if(num==1){
        item[0].className='border'
        item[1].className=''
        fenlei[0].style.display='block'
        fenlei[1].style.display='none'
    }
    if(num==2){
        item[0].className=''
        item[1].className='border'
        fenlei[0].style.display='none'
        fenlei[1].style.display='block'
    }
}

//声明一个函数，用来获取服务器的数据
function getData(){
    //获取后台数据库代码
    //视频的数据代码
    var  datacideo='http://81.71.65.4:3008/video/list'
    axios.get(datacideo).then(function (result){
        //我们要的数据放在result.data.data里面
        var list=result.data.data;
        console.log(list)
        var listName=''
        for(var item in list){
            listName+=
            `<a onclick="location.href='./details.html?id=${list[item].id}'">
            <div class="main">
              <div class="main1">
                <img
                  class="picture1"
                  src="${list[item].imgUrl}"
                  alt=""
                />
                <p class="introduce">
                  ${list[item].title}
                </p>
                <img class="picture2"  src="https://s0.meituan.net/bs/myfe/canary/file/asgard/images/media/video-btn-play.png" alt=""/>
              </div>
              <div class="main2">
                <img
                  src="${list[item].avatarurl}"
                  alt=""
                />
                <p>${list[item].nickName}</p>
                <div><i class="iconfont icon-dianzan"></i><span>${list[item].upCount}</span></div>
                <div><i class="iconfont icon-duihuaxinxi"></i><span>${list[item].commentCount}</span></div>
                <i class="iconfont icon-fenxiang1"></i>
              </div>
            </div>
            </a>`
        }
        document.querySelector('.content1').innerHTML=listName
    });



    //资讯的数据库代码
    var dataUrl='http://81.71.65.4:3008/info/list'
    axios.get(dataUrl).then(function (result){
        //我们要的数据放在result.data.data里面
        var list=result.data.data;
        // console.log(list)
        var listName=''
        for(var item in list){
            listName+=
            `<div class="maintwo">
            <div>
              <p>${list[item].title}</p>
              <p>${list[item].desc}</p>
            </div>
            <img src="${list[item].imgUrl}" alt="">
          </div>`
        }
        document.querySelector('.content2').innerHTML=listName
    });

}
getData();